var UserController = require('../Controllers/User');
var ProjectController = require('../Controllers/Project');
var VersionController = require('../Controllers/Version');
var TestRecordController = require('../Controllers/TestRecord');
var TestReportController = require('../Controllers/Report');

module.exports = router => {
//user
router.post(`/user/register`, UserController.register);
router.post(`/user/login`, UserController.login);
router.post(`/user/add`, UserController.addUser);
router.post(`/user/list`, UserController.getUserList);
router.post(`/user/update`, UserController.updateUser);
router.post(`/user/logout`, UserController.logout);
router.delete(`/user/delete`, UserController.deleteUser);
router.post(`/user/query`, UserController.queryUsers);
router.get(`/currentUser`, UserController.getCurrentUser);

//project
router.post(`/project/add`, ProjectController.addProject);
router.delete(`/project/delete`, ProjectController.deleteProjectById);
router.post(`/project/update`, ProjectController.updateProject);
router.post(`/project/info`, ProjectController.getProjectById);
router.get(`/project/list`, ProjectController.getProjectList);
router.post(`/project/versionlist`, ProjectController.getVersionByProjectId);
router.post(`/project/queryCurrentUserOwnedProjects`, ProjectController.getCurrentUserOwnedProjects);


//version
router.post('/version/add', VersionController.addVersion);
router.post('/version/update', VersionController.updateVersion);
router.delete('/version/delete', VersionController.deleteVersionById);
router.post(`/version/getProjectVersionList`,VersionController.getVersionList);


//testRecord
router.post('/testrecord/add', TestRecordController.addTestRecord);
router.delete('/testrecord/delete', TestRecordController.deleteTestRecord);
router.post('/testrecord/update', TestRecordController.updateTestRecord);
router.post('/testrecord/pmCheckPass', TestRecordController.testReocrdPMCheckPass);
router.post('/testrecord/pmCheckFail', TestRecordController.testReocrdPMCheckFail);
router.post('/testrecord/testCheckPass', TestRecordController.testRecordTestCheckPass);
router.post('/testrecord/testCheckFail', TestRecordController.testRecordTestCheckFail);
router.post('/testrecord/activeList',TestRecordController.getActiveRecordList);
router.post('/testrecord/active', TestRecordController.getActiveRecord);
router.post('/testrecord/info', TestRecordController.getTestRecordInfo);
router.post('/testrecord/sendNews',TestRecordController.sendNews);
router.post('/testrecord/getTestCount',TestRecordController.getProjectTestCount);
router.post('/testrecord/getSuccessRate',TestRecordController.getLaunchTestSuccessRate);

//testReport
router.post('/testreport/add',TestReportController.addTestReport);
router.get('/testreport/getList',TestReportController.getReportList);
router.post('/testreport/deleteReport',TestReportController.deleteReport);
router.post('/testreport/editBasic',TestReportController.editBasic);
router.post('/testreport/editText',TestReportController.editText);
router.post('/testreport/activeReport',TestReportController.activeReport);
router.post('/testreport/setTestData',TestReportController.updateTestData);
router.post('/testreport/ReleaseReport',TestReportController.updateReportState);
router.post('/testreport/updateTestStatus',TestReportController.setTestStatus);
router.get('/testreport/getBasicData',TestReportController.getBasicDataArray);
router.post('/testreport/deleteBasicData',TestReportController.deleteBasicData);
router.post('/testreport/addBasicData',TestReportController.addBasicData);

//dynamiclogs

router.get('/workbanch/dynamiclogs',UserController.getDynamiclogs);

}